#include <iostream>
#include <zlib/eventsystem/P_Queue.h>

using namespace std;

int main()
{
	NegativeQueue q;
	Event e1;
	e1.init(NULL, -3, 0);
	q.enqueue(&e1);
	Event e2;
	e2.init(NULL, -1, 0);
	q.enqueue(&e2);
	Event e3;
	e3.init(NULL, -2, 0);
	q.enqueue(&e3);
	
	Event e4;
	e4.init(NULL, -4, 0);
	q.enqueue(&e4);

	cout << &e1 << " " << &e2 << " " << &e3 << " " << &e4 << endl;
	
	Event *e;
	while((e = q.dequeue()))
	{
		cout << e->timeout_at << " ";
	}

	return 0;
}
